/********************************************************/
/*	Copyright (C) 2016 Gong Li Bin			*/
/*	Project:	GlbCloud			*/
/*	Author:		gong_libin			*/
/*	Date:		2012_01_10			*/
/*	File:		MrRwLock.h			*/
/********************************************************/

#ifndef _MRRWLOCK_H
#define	_MRRWLOCK_H

#include "MrLock.h"

#define	MR_RW_RDLK			0x01
#define	MR_RW_WRLK			0x02

class CMrRwLock : public CMrLock
{
public:
	CMrRwLock();
	virtual ~CMrRwLock();

	int MrLockTryLock(UCHAR ucType);

	//virtual void MrLockFree();
	virtual int MrLockDelete();
	virtual int MrLockUnlock();
	virtual int MrLockLock(UCHAR ucType);
	virtual int MrLockCreate(bool bShared);
	virtual int MrLockMalloc(void* pRwLock);

private:
	int MrRwLockReadLock();
	int MrRwLockWriteLock();

	int MrRwLockTryReadLock();
	int MrRwLockTryWriteLock();

};

#endif /* _MRRWLOCK_H */
